package zxing.activity.adapter;

import android.content.Context;
import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import io.virtualapp.R;
import io.virtualapp.bean.MakeBean;

/********************
 *  Created by ：  lyq 
 *         Date：  2018\11\14 0014.
 * Introduction：   
 *********************/

public class MakeAdapter  extends BaseQuickAdapter<MakeBean, BaseViewHolder> {
    private int position;
    private int position1 = -1;
    private boolean isplay;//是否为播放
    private List<MakeBean> datas;

    public MakeAdapter(Context context, @Nullable List<MakeBean> data) {
        super(R.layout.item_list, data);
        this.datas = data;
    }

    @Override
    protected void convert(BaseViewHolder helper, MakeBean item) {
        helper.setText(R.id.txt_ringName, item.getTit());
        helper.setText(R.id.txt_time, item.getName());
        helper.addOnClickListener(R.id.item_parent);
        helper.addOnLongClickListener(R.id.item_parent);
    }

    public void setsele(int position1) {
        this.position1 = position1;
        notifyDataSetChanged();
    }

    public void setPlay(int position, boolean isplay) {
        this.position = position;
        this.isplay = isplay;
        notifyDataSetChanged();
    }

    public void removeData(int position) {
        datas.remove(position);
        notifyItemRemoved(position);
    }
}
